package homework.billing.meter.simple;

import homework.billing.meter.BaseItemsMeter;

public class SimpleTaxiMeter extends BaseItemsMeter {

    private float startingMileage;
    private float startingPrice;
    private float unitPrice;

    public SimpleTaxiMeter(float sp, float sm, float up) {
        startingMileage = sm;
        startingPrice = sp;

        unitPrice = up;
    }

    @Override
    public double mileageCost(float mileage) {
        if(mileage <= 0) return 0;

        double result = startingPrice;
        if(mileage > startingMileage)
            result += (mileage-startingMileage)*unitPrice;

        return result;
    }

    @Override
    public double waitingMinuteCost(float waiting) {
        return 0;
    }

    @Override
    public double totalMinuteCost(float totalMinute) {
        return 0;
    }
}
